The Karpathy LLM Wiki Pattern
Source: Karpathy's gist (14k+ stars)
A structured markdown knowledge base maintained by an LLM, not just queried by one.
Three Layers
1. Raw Sources (raw/)
Immutable documents — articles, PDFs, transcripts, images. The LLM reads but never modifies these.
2. Wiki (wiki/)
LLM-generated markdown pages: summaries, entity pages, concept pages, comparisons. The LLM owns this layer entirely.
3. Schema (CLAUDE.md / AGENTS.md)
Configuration telling the LLM how to structure, ingest, format, and cross-reference.
Three Operations
| Operation | What it does |
|---|---|
| Ingest | Fetch source into raw/, ripple-update wiki pages, update index + cross-references |
| Query | Search and answer with citations |
| Lint | Fix broken links, flag contradictions, find orphans, mark stale content |
Key Mechanics
- Ingesting one source can update 10-15 wiki pages (ripple updates)
index.md= content catalog;log.md= append-only activity record- Pages have frontmatter: title, type (concept/entity/source-summary/comparison), sources, related, confidence
- "The LLM is the programmer; Obsidian is the IDE; the wiki is the codebase"
Why It Matters
Personal wikis die because maintenance is boring. LLMs don't get bored. The pattern solves the fundamental problem of knowledge base decay by making the AI responsible for keeping everything consistent, cross-referenced, and up to date.